<?php
`net start mysql`;
`git config --global user.name "谷妍妍"`;
`git config --global user.email "3519927204@qq.com`;

$db = new PDO("mysql:host=localhost",'root','123456');
$db -> setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC);
$db -> exec('create database if not exists db2');
$db -> exec('use db2');
$db -> exec("create table if not exists students
(xh varchar(9) not null primary key,name varchar(50),tel varchar(11),pwd varchar(20) default '12345',isAdmin tinyint(1) default 0)");
$r = $db -> exec('delete from students');
echo "删除记录个数:{$r}条\n";
$r = $db -> exec("insert into students(xh,name,tel) values
                                         ('213110601','张三','11111111111'),
                                         ('213110602','李四','22222222222'),
                                         ('213110603','王五','33333333333'),
                                         ('213110701','杨柳','44444444444')");
$r = $db -> exec("insert into students(xh,name,tel) values('admin','管理员','00000000000')");
echo "插入记录个数:{$r}条\n";